package com.bosssoft.cloud.wechat.core.bean.msg.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.bosssoft.cloud.wechat.core.bean.WxBaseMsg;
import com.bosssoft.cloud.wechat.infrastructure.constant.WxKeywordConsts;
import com.bosssoft.cloud.wechat.infrastructure.annotation.XmlRoot;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * 回复视频消息
 *
 * @author wcy create on 2021/5/27 17:04 下午
 */
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@XmlRoot
public class VideoDTO extends WxBaseMsg {
    @JSONField(name = "Video")
    private MediaVO mediaVO;

    public VideoDTO(String toUserName, String fromUserName, MediaVO mediaVO) {
        super(toUserName, fromUserName, String.valueOf(System.currentTimeMillis() / 1000), WxKeywordConsts.MsgType.VIDEO);
        this.mediaVO = mediaVO;
    }

    @Data
    public static class MediaVO {
        /**
         * 通过素材管理中的接口上传多媒体文件，得到的id
         */
        @JSONField(name = "MediaId")
        private String mediaId;
        /**
         * 视频消息的标题
         */
        @JSONField(name = "Title")
        private String title;
        /**
         * 视频消息的描述
         */
        @JSONField(name = "Description")
        private String description;

        public MediaVO(String mediaId) {
            this.mediaId = mediaId;
        }
    }


}
